#include "mavlinktask.h"

unsigned long int mav_send_frequency = 0;
portTickType  Mav_lastFlashTime = 0;


void Task_MavLink(void *pvParameters)
{ 
  portBASE_TYPE xStatus; 
	//SYS_AHRS  DateReceive={0};
//	GPS_Data GPS_Receive = {0};
	//CONTRL cotrl_DateReceive={0};
  //UART1NVIC_Configuration();
	UART4NVIC_Configuration();
	const portTickType xTicksToWait=0/portTICK_RATE_MS;

	
	
	Mav_lastFlashTime=xTaskGetTickCount();
	
	
	for(;;)
	{
	 vTaskDelayUntil(&Mav_lastFlashTime,(portTickType)(20/portTICK_RATE_MS)); 
		
	  mav_send_frequency++;
		
	 //xStatus=xQueueReceive(AHRSToCommConQueue,&DateReceive,xTicksToWait);
	 	if(xStatus==pdPASS) 
	{

	}
 // xStatus=xQueueReceive(CotrlToCommConQueue,&cotrl_DateReceive,xTicksToWait);	
  if(xStatus==pdPASS) 
	{	
   }



//  xStatus=xQueueReceive(GPS_INSToCommConQueue,&GPS_Receive,xTicksToWait);
  if(xStatus==pdPASS) 
	{	

  }
   if(mav_send_frequency % 5 == 0)
   communication_system_state_send();
	 
	
	}
}